<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>

        This text above will not be displayed.

        <ui:composition template="/templateLogado.xhtml">

            This text will not be displayed.

            <ui:define name="title">
                index
            </ui:define>

            <ui:define name="content">

                <h3>
                    <h:form>

                        <h:outputText value="Turma:"/>
                        <br/>
                        <h:panelGrid columns="2">
                            <h:outputText value="Id: "/>
                            <h:outputText id="id" value="#{alunoTurmaMB.turmaCorrente.id}" />

                            <h:outputText value="Semestre: "/>
                            <h:outputText id="semestre" value="#{alunoTurmaMB.turmaCorrente.semestre}"/>

                            <h:outputText value="Ano: "/>
                            <h:outputText id="ano" value="#{alunoTurmaMB.turmaCorrente.ano}" />

                            <h:outputText value="Nome do Professor: "/>
                            <h:outputText id="nomeProfessor" value="#{alunoTurmaMB.turmaCorrente.nomeProfessor}"/>

                            <h:outputText value="Disciplina: "/>
                            <h:outputText id="comboBoxDisciplina" value="#{alunoTurmaMB.turmaCorrente.disciplina.nome}" />
                        </h:panelGrid>

                        <br/>
                        <h:outputText value="Escolha os alunos desejados:" />
                        <br/>
                        <br/>
                        <h:outputText value="Não há nenhum aluno disponível para inscrição." 
                                      rendered="#{alunoTurmaMB.alunosDisponiveis.isEmpty()}"/>
                        <br/>
                        
                        <h:selectManyCheckbox id="alunos" value="#{alunoTurmaMB.alunosSelecionados}" 
                                              rendered="#{!alunoTurmaMB.alunosDisponiveis.isEmpty()}"
                                              layout="pageDirection" >

                            <f:selectItems value="#{alunoTurmaMB.alunosDisponiveis}" />

                        </h:selectManyCheckbox>

                        <br/>
                        <h:commandButton value="Voltar" action="#{turmaMB.exibirTodas()}" immediate="true"/>

                        <h:commandButton value="Salvar" action="#{alunoTurmaMB.salvarInscricaoAlunos}"
                                         disabled="#{alunoTurmaMB.alunosDisponiveis.isEmpty()}"/>

                    </h:form>
                </h3>

            </ui:define>

            This text will not be displayed.

        </ui:composition>

        This text below will also not be displayed.

    </body>
</html>

